<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of group
 *
 * @author Andi
 */
include ("database.php");

class group extends database {
    //put your code here

    var $groupID;

    function  __construct() {
        $this->connect();
    }


    function getGroupID(){
        return $this->groupID;
    }

    function setGroupID($ID){
        $this->groupID = $ID;
    }

    function addMemberFirst($userID){
        $sql = "INSERT INTO group_member (user_id) VALUE ('$userID')";
        mysql_query($sql);
        $sql = "SELECT MAX(group_id) FROM group_member";
        $result = mysql_query($sql);
        $this->setGroupID($result);
    }

    function addMemberNext($userID){
        $sql = "INSERT INTO group_member (group_id,user_id) VALUE ('$this->getGroupID()','$userID')";
        mysql_query($sql);        
    }

}
?>
